package gwtappcontainer.server.apps;

import gwtappcontainer.shared.apis.APIResponse;
import gwtappcontainer.shared.apis.APIResponse.Status;

@SuppressWarnings("serial")
public class APIException extends RuntimeException {
	public Status statusCode;
	public String userFriendlyMessage;
	
	public APIException(Status statusCode, String userFriendlyMessage) {
		this.statusCode = statusCode;
		this.userFriendlyMessage = userFriendlyMessage;		
	}
	
	public APIResponse toRestResponse() {
		APIResponse resp = new APIResponse();
		resp.statusCode = statusCode;
		resp.userFriendlyMessage = userFriendlyMessage;
		
		return resp;
	}
}
